<script src="script/my_lightbox.js" language="javascript"></script>
<script>
closeimg='<{$config.weburl}>/image/default/icon_close.gif';
weburl='<{$config.weburl}>';
</script>
<script type="text/javascript" src="script/Validator.js"></script>
<script type="text/javascript">
var city='<{$de.city}>';
var province='<{$de.province}>';
function getHTML(v)
{	
	var ob="city";
	var url = '<{$config.weburl}>/ajax_back_end.php';
	var sj = new Date();
	var pars = 'shuiji=' + sj+'&prov_id='+v;
	var myAjax = new Ajax.Request(
				url,
				{method: 'post', parameters: pars, onComplete: showResponse}
				);
	function showResponse(originalRequest)
	{
		var tempStr = 'var MyMe = ' + originalRequest.responseText; 
		var i=0;var j=0;
		eval(tempStr);
		for(var s in MyMe)
			++j;
		$(ob).options.length =j+1;
		for(var k in MyMe)
		{
			var cityId=MyMe[k][0];
			var ciytName=MyMe[k][1];
			$(ob).options[k].value = cityId;
			$(ob).options[k].text = ciytName;
			if(city!=''&&city==ciytName)
				$(ob).options[k].selected = true;
	　	}
	 }
　}
<{if $de.city}>
	getHTML('<{$de.province}>');
<{/if}>
function ref()
{
	window.location='main.php?action=admin_personal&menu=<{$smarty.get.menu}>';
	window.location.hash="add";
}
</script>
	<{$slogin}>
	<div class="admin_right_top"><{$lang.profile}></div>
	<table border="0" cellpadding="7" cellspacing="1" bgcolor="#DDDDDD" class="admin_table">
	 <form action="" method="post" enctype="multipart/form-data" onSubmit="return Validator.Validate(this,3)">
	 <tr> 
		<td width="13%" align="left" bgcolor="#EAEFF3"><{$lang.userid}></td>
	    <td bgcolor="#FFFFFF" style="font-weight:normal"><{$smarty.cookies.USER}></td>
	 </tr>
	 <tr> 
		<td align="left" bgcolor="#EAEFF3"><{$lang.fullname}>* </td>
	   <td bgcolor="#FFFFFF">
	   <input name='name' type='text' id="name" value="<{$de.name}>" dataType="Require" msg="<{$lang.ar_con_user}>" style="width:250px;">	</td>
	 </tr>
	 	 <tr> 
		<td align="left" bgcolor="#EAEFF3"><{$lang.position}>* </td>
	   <td bgcolor="#FFFFFF"> <input name='position' type='text' id="position" value="<{$de.position}>" dataType="Require" msg="<{$lang.ar_position}>" style="width:250px;">	</td>
	 </tr>
	  <tr>
		<td align="left" bgcolor="#EAEFF3"><{$lang.xingbie}>*</td>
		<td bgcolor="#FFFFFF" style="font-weight:normal">
            <input name="sex" type="radio"  value="1" style="width:20px;border:none;"  <{if $de.sex==1}>checked="checked"<{/if}>/>
            <{$lang.boy}>
            <input name="sex" type="radio"  value="2" style="width:20px;border:none;"  <{if $de.sex==2}>checked="checked"<{/if}>/>
            <{$lang.gilr}>        </td>
	  </tr>
	  <tr> 
		<td align="left" bgcolor="#EAEFF3">Email* </td>
		<td bgcolor="#FFFFFF">
		<input name='email' type='text' value="<{$de.email}>" dataType="Require" msg="<{$lang.ar_email}>" style="width:250px;"></td>
	  </tr>
     <tr> 
		<td align="left" bgcolor="#EAEFF3">Email2</td>
		<td bgcolor="#FFFFFF">
		<input name='email2' type='text' value="<{$de.email2}>" style="width:250px;"></td>
	  </tr>
	  <tr> 
		<td align="left" bgcolor="#EAEFF3"><{$lang.tel}>* </td>
		<td bgcolor="#FFFFFF"><input name='tel' type='text' value="<{$de.tel}>" dataType="Require" msg="<{$lang.ar_tel}>" style="width:250px;"></td>
	  </tr>
	  <tr>
	    <td align="left" bgcolor="#EAEFF3"><{$lang.mobile}></td>
	    <td bgcolor="#FFFFFF"><input name="mobile" type="text" id="mobile" value="<{$de.mobile}>" style="width:250px;"></td>
       </tr>
	  <tr>
		<td align="left" bgcolor="#EAEFF3">Q Q</td>
		<td bgcolor="#FFFFFF" style="font-weight:normal"><input name="qq" type="text" value="<{$de.qq}>" maxlength="10" style="width:250px;"></td>
	  </tr>
	  <tr>
		<td align="left" bgcolor="#EAEFF3">MSN</td>
		<td bgcolor="#FFFFFF"><input name="msn" type="text" value="<{$de.msn}>" maxlength="30" style="width:250px;"></td>
	  </tr>  
	  <tr>
		<td align="left" bgcolor="#EAEFF3">skype</td>
		<td bgcolor="#FFFFFF"><input name="skype" type="text" value="<{$de.skype}>"  style="width:250px;"></td>
	  </tr>

	  <tr> 
		<td align="left" bgcolor="#EAEFF3"><{$lang.province}>/<{$lang.city}>* </td>
		<td bgcolor="#FFFFFF">
		   <{if $de.country=='china' or $de.country=='China' or $de.country=='中国'}>
				<select  name="province" id="province" onChange="getHTML(this.value)" style="width:123px;" />
				<option value=""><{$lang.ar_province}></option>
				<{$prov}>
				</select>
				<select name="city" id="city" style="width:123px;" />
				<option value=""><{$lang.ar_city}></option>
				</select>
		   <{else}>
				<input style="width:120px;" id="province1" name="province1" type="text" value="<{$de.province}>"/>
				<input style="width:120px;" id="city1" name="city1" type="text" value="<{$de.city}>"/>
			<{/if}>
		</td>
	  </tr>
  <tr> 
	<td align="left" bgcolor="#EAEFF3"><{$lang.picture}></td>
	<td bgcolor="#FFFFFF" style="font-weight:normal">
		<input style="width:250px;" name="logo" type="text" id="logo" value="<{$de.logo}>">
		[<a href="javascript:uploadfile('LOGO','logo',300,300)"><{$lang.upload}></a>] 
		[<a href="javascript:preview('logo');"><{$lang.preview}></a>]
		[<a href="javascript:delet_pic('logo');"><{$lang.delete}></a>]
	</td>
  </tr>
  <tr> 
	<td align="right" bgcolor="#EAEFF3"> </td>
	<td bgcolor="#FFFFFF">
	  <input  type='submit' name='Submit' value='<{$lang.submit}>' style="width:80px;">
	  <input name="action" type="hidden" id="action" value="update" />
	  </td>
  </tr>
  </form>
</table>

<!-- 非个人会员，并且非子会员才有此功能。-->
<{if $de.pid==''&&$smarty.session.USER_TYPE>1}>
	<br /><a name="add"></a>
	<div class="admin_right_top"><{$lang.add_more_user}></div>
	<script src="script/my_lightbox.js" language="javascript"></script>
	<table width="100%" border="0" cellpadding="7" cellspacing="1" bgcolor="#DDDDDD" class="admin_table">
	  <tr>
		<td width="15%" bgcolor="#EAEFF3"><{$lang.userid}></td>
		<td width="18%" bgcolor="#EAEFF3"><{$lang.fullname}></td>
		<td width="22%" bgcolor="#EAEFF3"><{$lang.position}></td>
		<td width="17%" bgcolor="#EAEFF3"><{$lang.tel}></td>
		<td width="15%" bgcolor="#EAEFF3">Email</td>
		<td width="13%" bgcolor="#EAEFF3"><{$lang.operation}></td>
	  </tr>
	  <{foreach item=list from=$plist}>
	  <tr>
		<td bgcolor="#FFFFFF"><{$list.user}></td>
		<td bgcolor="#FFFFFF"><{$list.name}></td>
		<td bgcolor="#FFFFFF"><{$list.position}></td>
		<td bgcolor="#FFFFFF"><{$list.mobile}></td>
		<td bgcolor="#FFFFFF"><{$list.email}></td>
		<td bgcolor="#FFFFFF">
		<a href="javascript:alertWin('<{$lang.add_more_user}>','',600,390,'main.php?menu=user&action=admin_personal&adduser=true&editid=<{$list.userid}>');"><{$lang.edit}></a> | 
		<a href="main.php?action=admin_personal&deid=<{$list.userid}>&menu=<{$smarty.get.menu}>#add"><{$lang.delete}></a></td>
	  </tr>
	  <{/foreach}>
	</table>
	<div style="padding:5px;">
	<input value="<{$lang.add}>" onclick="alertWin('<{$lang.add_more_user}>','',600,390,'main.php?menu=user&action=admin_personal&adduser=true');" type="button" />
	</div>
<{/if}>